The present invention relates generally to semiconductor microprocessors, to a class of microprocessors known as microcontrollers which perform selective control functions, and more particularly to programmable microcontrollers which are adapted to be programmed in-system without adversely affecting the controlled system functions.
The evolution of microprocessors into complex instruments and machines has led to sophisticated, fast real-time control capability. Large microprocessors of 16 or 32 bit capability with associated interrupt handler chips, programmable timer chips, ROM and RAM chips, have been replaced in many control function instances by single chip microcontrollers with all peripherals embedded on the same chip with the microcontroller. Operation of the chip in an expanded mode enhances the versatility of all on-chip features. Microcontrollers are used in a wide diversity of present-day applications, with new applications found almost daily. In hand-held instruments such as tiny pocket-sized pagers, the microcontroller is responsive to received characters to interpret them, produce an audible signal to notify the user of an incoming message (or not if the user prefers an inaudible mode), and produce multiple messages among the several last of those received on a suitable display, typically an LCD. The microcontroller can also recall from its internal memory any or all of the messages received in a given period of time. Among its other instrumentation uses are those as meters and testers, capable of carrying out thousands of tests, each in a millisecond or less.
Other applications include keyboard controllers for personal computers, in which the microcontroller serves to offload many tasks formerly handled by the processor, including continuous performance of numerous diagnostic procedures and notification to the processor if a problem is detected. Among other personal computer applications, microcontrollers are used in modems for command interpretation and data transmission, in printer buffers for high speed dumping of data in preparation for driving the printer at the appropriate speed, or for color plotters, in color copiers, electronic typewriters, cable television terminal equipment, lawn sprinkling controllers, credit card phone equipment, automotive applications such as engine control modules, antilock braking systems, automobile suspension control for desired designation of ride softness or rigidity according to user preference, and a host of other applications daily by industrial and consumer customers.
A real time microcontroller provides rapid solutions to signal processing algorithms and other numerically intensive computations, controls events such as opening and closing of relays, the position and speed of a motor, and other control functions such as those mentioned above. The central processing unit (CPU) of the microcontroller operates in conjunction with certain peripherals to perform the control function, including devices such as timers, signal ports, and baud rate generators, among others.
The present invention is incorporated in an enhancement of an 8-bit user programmable reduced instruction set capability (RISC) microcontroller family manufactured and marketed by Microchip Technology Incorporated of Chandler, Ariz. (assignee of this application) as its PIC.RTM.16C5X family of CMOS (complementary metal-oxide-silicon) EPROM (electrically programmable read-only memory) -based microcontrollers. The enhanced user-programmable single chip device addresses the burgeoning number of embedded control applications requiring economical analog sensing and control applications. The PIC.RTM.16C5X utilizes, among other things, a 12 I/O (input/output) port configuration with 12-bit instruction words. The enhanced microcontroller in which the present invention is utilized retains the same 12 I/O pin configuration, in part for the sake of compatibility, but its instruction word length is increased to 14 bits.
It is a principal object of the present invention to provide apparatus and method which permits the use of 14-bit instruction words despite the presence of only 12 I/O ports in the microcontroller.
User programmability is a popular feature of the PIC16C5X family of microcontroller devices, and it is another broad object of the present invention to enhance that feature by providing the new device with in-system programmability, by which the device may be user-programmed while it is actually embedded in a system to be controlled.
The significance of in-system or in-circuit programmability may be explained as follows. Most programmable semiconductor integrated circuit devices are programmed while residing outside the system in which they will operate, i.e., typically before they are plugged or soldered into the system circuit board. In contrast, the present invention provides a technique and implementation whereby the packaged integrated circuit microcontroller chip with on chip program memory may be soldered or plugged into the system which it is intended to control, and afterward programmed in whatever manner the user desires within the constraints imposed by the device itself.
This capability is especially important in a number of control applications. One example is in a steering wheel control, where typically, after the system board containing the microcontroller device is assembled and plugged into the electronics of the automobile, a final adjustment is required to be performed owing to the slight difference in handling characteristics between every car coming off the production line. Through testing performed by the device user (the automobile manufacturer), a set of parameters may be developed to be programmed into the device as this final adjustment. Clearly, that could not be accomplished prior to completion of the system which is embedded in the steering wheel assembly. Nor is it feasible to build the system on-site with the necessary final adjustments made in place, without the use of in-circuit or in-system programming. The advantage of the latter is that fine tuning of a particular adjustment, or, more broadly, matching of a set of parameters to a variable target, can be customized at the time the device, system or circuit to be controlled is in its final phase(s) of manufacture or assembly. It is not necessary, and, with reference to the above example, the required information may not even be known, to perform final adjustments (by way of programming) on the microcontroller device at the factory where it is fabricated, prior to assembly of the microcontroller into the system to be controlled. Thus, a typical requirement of in-system programming exists where a controllable system is already constructed--or very nearly so--and performs the general function, but lacks customization.
In-system programming per se is not new, in that certain prior art semiconductor devices such as PLDs (programmable logic devices) have heretofore had limited in-system programming capabilities. However, although such in-system programmability exists, the programming mode of the PLD is not an operating mode but, rather, another and different mode of operation. After it is programmed, the PLD circuit must be operated in its normal operating mode, and, to that end, two or more additional pin-outs have been added to the device for clock, data or other lines, to get information in and out of the device. This adds to device complexity and size.
Therefore, another object of the invention is to provide a semiconductor device which may be programmed while in circuit without the need for additional pins relative to those utilized for the normal circuit or system operating mode.
A further object of the invention is to provide a microcontroller device which may be user-programmed while embedded in the system which is to undergo control.
Typically, the prior art devices that are programmable in-system, such as PLDs and like devices, are based on EEPROM technology, which is inherently designed to be programmed, being electrically readable and writable, while in-system. According to a feature of the present invention, however, an EPROM-based microcontroller is provided with in-system programmability. In the latter case, the device requires larger voltages on the pins, which presents more complex issues to in-system programmability.